home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Art⁄Graphics / PvRay05d1 Folder / Examples / CRYSTAL.DAT < prev    next >
Encoding:
Text File  |  1992-05-24  |  2.7 KB  |  102 lines  |  [TEXT/????]

  1. // Persistence of Vision Raytracer
  2. //---------------------------------------------------------------------------
  3. // This data file is designed to emulate the digitized photographic image
  4. // of a crystal sphere on a checkerboard that David Buck took, and to
  5. // verify or refute the correctness of the current refractive functions
  6. // in PV-Trace beta 0.5.  The original image is available on CompuServe
  7. // (GO COMART), Library 16 by the name of CRYSTA.GIF.
  8. // Experiment with the index-of-refraction value for the crystal ball.
  9. //---------------------------------------------------------------------------
  10.  
  11. #include "colors.dat"
  12. #include "shapes.dat"
  13. #include "textures.dat"
  14.  
  15. view_point
  16.     location <-1.5 17 -18>
  17.     direction <0 0 2.75>
  18.     up  <0 1 0>
  19.     right <1.33333 0 0>
  20.     look_at <0 2 0>
  21. end_view_point
  22.  
  23. object   { main light source , overhead }
  24.    sphere <0 0 0> 0.1 end_sphere
  25.    translate <-5 50 -5>
  26.    texture
  27.       ambient 1
  28.       diffuse 0
  29.       colour White
  30.    end_texture
  31.    colour red 0.85 green 0.85 blue 0.85
  32.    light_source
  33. end_object
  34.  
  35. object   { fill lighting }
  36.    sphere <0 0 0> 0.1 end_sphere
  37.    translate <-500 500 -500>
  38.    texture
  39.       ambient 1
  40.       diffuse 0
  41.       colour DimGray
  42.    end_texture
  43.    colour DimGray   { Low light level }
  44.    light_source
  45. end_object
  46.  
  47. object   { light (under checkerboard, for background }
  48.    sphere <0 0 0> 0.1 end_sphere
  49.    translate <10 -50 5>
  50.    texture
  51.       ambient 1
  52.       diffuse 0
  53.       colour White
  54.    end_texture
  55.    colour White
  56.    light_source
  57. end_object
  58.  
  59. object    { The background.  Designed to give the shaded quality of the photo}
  60.    quadric QSphere
  61.       scale <10000 500 500>
  62.       rotate <0 60 0>
  63.    end_quadric
  64.    colour CBlue
  65.    texture 0.025
  66.       ambient 0.2
  67.       diffuse 0.75
  68.       color Gray
  69.    end_texture
  70. end_object
  71.  
  72. composite
  73.     object   { The checkerboard, scaled pretty closely }
  74.        intersection Cube scale <6 0.001 6> end_intersection
  75.        colour Gray
  76.        texture 0.015
  77.           checker color Black color White
  78.           scale <1.15 1 1.15>
  79.           translate <0.30 0.0 -0.30>
  80.           ambient 0.35
  81.           diffuse 0.65
  82.        end_texture
  83.     end_object
  84.  
  85.     object
  86.        sphere <-0.5 2.65 -0.5> 2.65 end_sphere
  87.        colour White
  88.        texture
  89.            color red 1.0 green 1.0 blue 1.0  alpha 0.75
  90.            ambient 0.2
  91.            diffuse 0.0
  92.            reflection 0.12
  93.            refraction 1.0
  94.            ior 2.0  { <-- Experiment with values from 1.4 to 2.8 }
  95.            specular 1.0 roughness 0.001
  96.        end_texture
  97.     end_object
  98.  
  99.     rotate <0 0 -10.5>    { Simulate the slight camera tilt in the photo }
  100. end_composite
  101.  
  102.